$(function(){

	/*layui.use('element', function(){
		var element = layui.element();
	});*/

	/*$('.step-square li').hover(function(){
		$(this).find('.dispose-info').removeClass('sr-only');
	},function(){
		$(this).find('.dispose-info').addClass('sr-only');
	});*/

	layui.use(['layer','form'],function(){

		//如果有留言就显示
		$('.myTooltip').hover(function(){
			$(this).find('.popover-box').removeClass('sr-only');
		},function(){
			$(this).find('.popover-box').addClass('sr-only');
		});

		// 点击删除
		$('.close-sample').click(function(){

			var sample_id = $(this).attr('order_id');

			layer.confirm('您确定要删除此单？', {
				btn: ['确定','取消'] //按钮
			}, function(){

				$.ajax({
                    url : '/Sample/delOrder',
                    type : 'post',
                    dataType : 'JSON',
                    data : {
						id : sample_id
                    },
                    beforeSend : function(){
                        layer.load(2, { shade : [0.5,'#fff'] });
                    },
                    success : function( response ) {
						if(response.flag > 0){
							layer.msg(response.msg,{icon:1,time:2000})
                            location.href = 'http://' + ThinkPHP['HTTP_HOST'] + '/Sample';
						}else{
                            layer.msg(response.msg,{icon:2,time:2000})
                            location.href = 'http://' + ThinkPHP['HTTP_HOST'] + '/Sample';
                        }
                    }
				});


			}, function(){



			});


		})

    })

});